package com.orangelife.mobile.surrounding.biz;

import android.text.Html;
import android.text.Spanned;

import com.orangelife.mobile.constants.Constant;
import com.orangelife.mobile.surrounding.entity.MerchantEntity;

/**
 * Created by Administrator on 2016/1/18.
 */
public class MerchantBiz {
    /** 配送方式（1邮寄，2到店提货，3送货上门) */
    public static Spanned getDispatchInfo(MerchantEntity.DispatchInfoEntity die) {
        String dispatchName = die.getDispatchName();
        String dispatchTypeCode = die.getDispatchType();
        String limitFee = die.getLimitFee();
        String preLimitFee = "满";
        if (!"0".equals(limitFee)) {
            limitFee = Constant.RMB_FLAG + limitFee;
        } else {
            preLimitFee = "";
            limitFee = "";
        }
        String dispatchType = "";
        if ("1".equals(dispatchTypeCode)) {
            dispatchType = "免邮寄费";
        } else if ("2".equals(dispatchTypeCode)) {
            dispatchType = "到店提货";
            limitFee = "";
        } else {
            dispatchType = "免配送费";
        }
        Spanned spanned = Html.fromHtml(preLimitFee + "<font color=#fea00f><strong><big>" + limitFee + "</big></strong></font>" + dispatchType);
        return spanned;
    }


}
